<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">

<wicket:border>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <title>Dashboard | Melon - Flat &amp; Responsive Admin Template</title>
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="res/media/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/style-metro.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/select2_metro.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/style-responsive.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/default.css" rel="stylesheet" type="text/css" id="style_color"/>
    <link href="res/media/css/uniform.default.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/DT_bootstrap.css" rel="stylesheet" type="text/css"/>
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL STYLES -->
    <link href="res/media/css/jquery.gritter.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/daterangepicker.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/fullcalendar.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/jqvmap.css" rel="stylesheet" type="text/css" media="screen"/>
    <link href="res/media/css/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css" media="screen"/>
    <link href="res/media/css/lock.css" rel="stylesheet" type="text/css"/>
    <link href="res/media/css/error.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="res/media/js/car_price/car_common_style.css" media="all">
    <link rel="stylesheet" type="text/css" href="res/media/css/bootstrap-tree.css"/>
    <link rel="stylesheet" type="text/css" href="res/media/css/multi-select-metro.css"/>
    <link rel="stylesheet" type="text/css" href="res/media/css/bootstrap-toggle-buttons.css"/>
    <!-- END PAGE LEVEL STYLES -->
    <link rel="stylesheet" href="res/media/js/dist/themes/default/style.min.css"/>
</head>
<body class="page-header-fixed">

<wicket:link>
    <div id="header" wicket:id="header">header</div>
</wicket:link>

<div id="container" class="page-container">


    <wicket:link>
        <div wicket:id="menu">menus</div>
    </wicket:link>


    <div class="page-content" id="content">
        <wicket:body/>
    </div>


</div>
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->

<!--<script src="res/media/js/jquery-1.10.1.min.js" type="text/javascript"></script>-->
<script src="res/media/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<script src="res/media/js/jquery-1.3.1.js" type="text/javascript"></script>
<script src="res/media/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>
<script src="res/media/js/bootstrap.min.js" type="text/javascript"></script>
<script src="res/media/js/excanvas.min.js"></script>
<script src="res/media/js/respond.min.js"></script>
<script src="res/media/js/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="res/media/js/jquery.blockui.min.js" type="text/javascript"></script>
<script src="res/media/js/jquery.cookie.min.js" type="text/javascript"></script>
<script src="res/media/js/jquery.uniform.min.js" type="text/javascript"></script>
<script src="res/media/js/jquery.flot.js" type="text/javascript"></script>
<script src="res/media/js/jquery.flot.resize.js" type="text/javascript"></script>
<script src="res/media/js/jquery.pulsate.min.js" type="text/javascript"></script>
<script src="res/media/js/date.js" type="text/javascript"></script>
<script src="res/media/js/daterangepicker.js" type="text/javascript"></script>
<script src="res/media/js/jquery.gritter.js" type="text/javascript"></script>
<script src="res/media/js/fullcalendar.min.js" type="text/javascript"></script>
<script src="res/media/js/jquery.easy-pie-chart.js" type="text/javascript"></script>
<script src="res/media/js/jquery.sparkline.min.js" type="text/javascript"></script>
<script type="text/javascript" src="res/media/js/select2.min.js"></script>
<script src="res/media/js/app.js"></script>
<script src="res/media/js/index.js" type="text/javascript"></script>
<script src="res/media/js/form-samples.js"></script>
<script src="res/media/js/lock.js"></script>
<script src="res/media/js/jquery.backstretch.min.js" type="text/javascript"></script>
<script type="text/javascript" src="res/media/js/jquery.multi-select.js"></script>
<script type="text/javascript" src="res/media/js/layer/layer.min.js"></script>

<script>
    jQuery.fn.selectCity = function(targetId) {
        var _seft = this;
        var targetId = $(targetId);

        this.click(function(){
            var A_top = $(this).offset().top + $(this).outerHeight(true);  //  1
            var A_left =  $(this).offset().left;
            // targetId.bgiframe();
            targetId.show().css({"position":"absolute","top":0+"px" ,"left":A_left+"px"});
        });

        targetId.find("#selectItemClose").click(function(){
            targetId.hide();
        });

        targetId.find("#selectSub :button").click(function(){
            /*  targetId.find(":text").attr("checked",false);
             $(this).attr("text",true);*/
            /*  _seft.val( $(this).val() );*/
            if($(this).val() =="有"){
                $("#address").attr("src","../../res/media/image/q_product_dian.gif")
            }else{
                $("#address").attr("src","../../res/media/image/q_product_gang.gif")
            }

            targetId.hide();
        });

        targetId.find("#selectSub>img[id='dian_img']").click(function(){
            /*  targetId.find(":text").attr("checked",false);
             $(this).attr("text",true);*/
            /*  _seft.val( $(this).val() );*/
            $("#address").attr("src","../../res/media/image/q_product_dian.gif")
            targetId.hide();
        });

        targetId.find("#selectSub>img[id='gang_img']").click(function(){
            /*  targetId.find(":text").attr("checked",false);
             $(this).attr("text",true);*/
            /*  _seft.val( $(this).val() );*/
            $("#address").attr("src","../../res/media/image/q_product_gang.gif")
            targetId.hide();
        });
        $(document).click(function(event){
            if(event.target.id!=_seft.selector.substring(1)){
                targetId.hide();
            }
        });

        targetId.click(function(e){
            e.stopPropagation(); //  2
        });

        return this;
    }

    $(function(){
        //test1:
        $("#address").selectCity("#selectItem");
        //test2：
        $("#address2").selectCity("#selectItem2");
    });
</script>
<script>
    jQuery(document).ready(function () {
        App.init(); // initlayout and core plugins
        Lock.init();
/*      TableEditable.init();
        FormSamples.init();
        FormComponents.init();
        UITree.init();*/
      /*  Index.init();
        Index.initChat();
        Index.initMiniCharts();
        Index.initDashboardDaterange();
        Index.initIntro();*/
    });
</script>
<script>
   document.onreadystatechange = subSomething;//当页面加载状态改变的时候执行这个方法.
     function subSomething()
     {
     var ii = layer.load('加载中');
     setTimeout(function(){

     if(document.readyState == "complete"){
     layer.close(ii);
     } //当页面加载状态*//*

     }, 1000);
     }
</script>
<script type="text/javascript">  var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-37564768-1']);
_gaq.push(['_setDomainName', 'keenthemes.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function () {
    var ga = document.createElement('script');
    ga.type = 'text/javascript';
    ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(ga, s);
})();</script>




<script type="text/javascript">
// 车贷广告link
var ADForCheDai = {
    CsAllSpellArray: new Array(),
    SetCheDaiADLink: function (carid) {
        var ddlCs = $("ddlChexing");
        if (!ddlCs)
            return;
        var csId = ddlCs.options[ddlCs.options.selectedIndex].value;
        if (ADForCheDai.CsAllSpellArray && ADForCheDai.CsAllSpellArray.length > 0 && ADForCheDai.CsAllSpellArray[csId]) {
            var chedaiLink = $("chedaiADLink");
            if (chedaiLink) {
                if (carid <= 0) {
                    var hidCarId = document.getElementById("hidCarID");
                    if (hidCarId && hidCarId.value > 0)
                    { carid = hidCarId.value; }
                }
                chedaiLink.innerHTML = "<a target=\"_blank\" href=\"/" + ADForCheDai.CsAllSpellArray[csId]
                        + "/chedai/sq/m" + carid + "/?ref=sq4\">贷款买车>></a>";
            }
        }
    }
};
var webSiteBaseUrl = "http://car.bitauto.com/";
function InitControl() {
    InitVehicleAndVesselTaxControl("tdVehicleAndVesselTaxContainer");
}

function CarCalculation() {
    calcAutoLoanAll();
}

var priveRequest = "";
var hasAdSerials = [2601, 1825, 1703, 2731, 2614, 2388, 2862, 2945, 2608, 1930, 1828, 2410, 1835, 1833, 1827, 1839, 1834, 2012, 1838, 2712, 2874, 2764, 3167, 2612, 1574, 2334, 1569, 1575, 1660, 2780, 1661, 2676, 2589, 2288, 2057, 2859, 3269, 1636, 1650, 2866, 1635, 3152, 3153, 3164, 2895, 1649, 3263, 1648, 2865, 2833, 2683, 2767, 3023, 2587, 2857, 3023, 3103, 3151, 2713, 1618, 1605, 1619, 1617, 1740, 2733, 1925, 2742, 2604, 1736, 1733, 1751, 1851, 2773, 2867, 3129, 3210, 3209, 1755, 2749, 1654, 2708, 2251, 2585, 2692, 2949, 2420, 1594, 2618, 1595, 1596, 2834, 2971, 2335, 2836, 2907, 3022, 2929, 2748, 1684, 1683, 2283, 1678, 2719, 1681, 1682, 3086, 1622, 2625, 2369, 1787, 1607, 2194, 2950, 2711, 1785, 1789, 2747, 1784, 3250, 3251, 3252, 1667, 1666, 2703, 2417, 2761, 2381, 2932, 2714, 1863, 1905, 1909, 1765, 1871, 2848, 1879, 2701, 1977, 2407, 1873, 1914, 2566, 2944, 2938, 2677, 1918, 3046, 3261, 2964, 3368, 2957, 2759, 2963, 3360, 2693, 2182, 1969, 3186, 2709, 2366, 2403, 2425, 2741, 3348, 1978, 2906, 3061, 3304, 2633, 2846, 1633, 2336, 3026, 2576, 1692, 3301];
function initAutoLoanData() {

    //var rdoAcquisitionTax = document.getElementsByName("rdoAcquisitionTax");
    //rdoAcquisitionTax[0].checked = true;

    var rdoCompulsory = document.getElementsByName("rdoCompulsory");
    rdoCompulsory[0].checked = true;

    var rdoTPL = document.getElementsByName("rdoTPL");
    rdoTPL[1].checked = true;

    var rdoBreakageOfGlass = document.getElementsByName("rdoBreakageOfGlass");
    rdoBreakageOfGlass[1].checked = true;

    var rdoCarDamageDW = document.getElementsByName("rdoCarDamageDW");
    rdoCarDamageDW[1].checked = true;

    getDefaultValue();

}
function bindSelect() {
    var hidBsId = document.getElementById("hidBsID");
    var hidCsId = document.getElementById("hidCsID");
    var hidCarId = document.getElementById("hidCarID");
    var mdvalue = "0", sdvalue = "0", cdvalue = "0";
    if (hidCarId && hidCarId.value > 0) {
        mdvalue = (hidBsId || hidBsId.value != "") ? hidBsId.value : 0;
        sdvalue = hidCsId ? hidCsId.value : 0;
        cdvalue = hidCarId ? hidCarId.value : 0;
        resetPrice(hidCarId.value);
        calcAutoLoanAll();
    }
}
function calcAutoLoanAll() {

    if ($('txtMoney').value.length == 0 || $('txtMoney').value == 0) {
        $('rdoDownPaymentsOfSelf').disabled = true;
        $('txtDownPayments').disabled = true;
    }
    else {
        $('rdoDownPaymentsOfSelf').disabled = false;
        if ($('rdoDownPaymentsOfSelf').checked)
            $('txtDownPayments').disabled = false;
        else
            $('txtDownPayments').disabled = true;
    }

    if (!checkMoneyValidation()) {
        return false;
    }

    if ($('txtMoney').value == 0) {
        $('txtDownPayments').value = 0;
        $('txtLoanValue').value = 0;
        $('txtMonthPayments').value = 0;
        $('txtFirstDownPayments').value = 0;

        $('txtAcquisitionTax').value = 0;
        $('txtVehicleTax').value = 0;

        $('txtCompulsory').value = 0;
        $('txtCommonTotal').value = 0;
        $('txtTPL').value = 0;
        $('txtCarDamage').value = 0;
        $('txtTPL').value = 0;
        $('txtCarTheft').value = 0;
        $('txtBreakageOfGlass').value = 0;
        $('txtSelfignite').value = 0;
        $('txtAbatement').value = 0;
        $('txtBlameless').value = 0;
        $('txtCarDamageDW').value = 0;

        $('txtChePai').value = 0;
        $('txtLimitOfPassenger').value = 0;

        //首付款总额=首付款+必要花费+商业保险
        //必要花费，商业保险同全款购车。
        //您需要首付=首付款总额；月供=月付款；总计花费=首付款总额+月付款×还款年限×12
        //比全款购车多花费=总计花费-车辆购置价格。
        calcTotal();

        return;
    }

    if (!checkChePaiValidation()) {
        return false;
    }
    //贷款统计
    //LoanStatisticsClick();
    //首付款
    calcDownPayments();
    //贷款额
    calcLoanValue();
    //月付款
    calcMonthPayments();
    //------------------------
    //购置税
    calcAcquisitionTax();
    //车船使用税
    CalculateVehicleAndVesselTax();
    //交强险
    calcCompulsory();
    //第三者责任险
    calcTPL();
    //车辆损失险
    calcCarDamage();
    //全车盗抢险
    calcCarTheft();
    //玻璃单独破碎险
    calcBreakageOfGlass();
    //自燃损失险
    calcSelfignite();
    //不计免赔特约险
    calcAbatement();
    //无过责任险
    calcBlameless();
    //车上责任险
    calcLimitofPassenger();
    //车身划痕险
    calcCarDamageDW();
    //常规保险合计
    calcCommonTotal();
    //---------------------------------
    calcFirstDownPayments();
    //首付款总额=首付款+必要花费+商业保险
    //必要花费，商业保险同全款购车。
    //您需要首付=首付款总额；月供=月付款；总计花费=首付款总额+月付款×还款年限×12
    //比全款购车多花费=总计花费-车辆购置价格。
    calcTotal();
}

//----------------------------
//首付款：默认选择30%， 首付款=购车价格×首付比例，也可以不管首付比例，手动填写。
function calcDownPayments() {
    var rdoDownPayments = document.getElementsByName("rdoDownPayments");

    if (!rdoDownPayments[4].checked) {
        for (i = 0; i < rdoDownPayments.length; i++) {
            if (rdoDownPayments[i].checked) {
                $('txtDownPayments').value = Math.round($('txtMoney').value * rdoDownPayments[i].value);
                break;
            }
        }
    }
}

//月还款=贷款额×月利率×（1+月利率）^还款月数/（（1+月利率）^还款月数-1）
//        期限	    利率
//        12（1年）	0.5025
//        24（2年）	0.5025
//        36（3年）	0.5025
//        60（5年）	0.51

/*
 2011年后修改
 期限	年利率
 1年		5.81%
 2年		5.85%
 3年		5.85%
 4年		6.22%
 5年		6.22%

 贷款年限	贷款月利率
 1年期	0.4842%
 2年期	0.4875%
 3年期	0.4875%
 4年期	0.5183%
 5年期	0.5183%

 //2011-4-6 年利率
 1年期	6.31%；
 2年期	6.40%；
 3年期	6.40%；
 4年期	6.65%；
 5年期	6.65%

 1年期	月利率0.005258（0.5258%）；
 2年期	月利率0.005333（0.5333%）；
 3年期	月利率0.005333（0.5333%）；
 4年期	月利率0.005542（0.5542%）；
 5年期	月利率0.005542（0.5542%）

 //2011-07-08
 1年期	6.56%；
 2年期	6.65%；
 3年期	6.65%；
 4年期	6.90%；
 5年期	6.90%

 1年期	月利率：0.5467%；
 2年期	月利率：0.5542%；
 3年期	月利率：0.5542%；
 4年期	月利率：0.575%；
 5年期	月利率：0.575%

 //2013-01-21
 1年，2年，3年的贷款利率为 6.15%   月:0.5125%
 4年，5年的贷款利率为6.4%          月:0.5333%
 */


function calcMonthPayments() {
    if (!isNaN($('txtLoanValue').value)) {
        var monthPercent = 0.005467;
        var loanMonths = 12;

        var rdoPaymentYears = document.getElementsByName("rdoPaymentYears");
        for (i = 0; i < rdoPaymentYears.length; i++) {
            if (rdoPaymentYears[i].checked) {
                switch (rdoPaymentYears[i].value) {
                    case "1":
                        monthPercent = 0.005125;
                        break;
                    case "2":
                    case "3":
                        monthPercent = 0.005125;
                        break;
                    case "4":
                    case "5":
                        monthPercent = 0.005333;
                        break;
                }
                loanMonths = rdoPaymentYears[i].value * 12;
                break;
            }
        }

        $('txtMonthPayments').value = Math.round($('txtLoanValue').value * monthPercent * Math.pow((1 + monthPercent), loanMonths) / (Math.pow((1 + monthPercent), loanMonths) - 1));
    }
}

function resetTxtDownPayments() {
    window.setTimeout(function () { $('txtDownPayments').focus(); }, 0);
    $('txtDownPayments').disabled = false;
    $('txtDownPayments').select();
}
//
function checkTxtDownPayments() {
    if ($('txtDownPayments').value.length == 0) {
        alert("请输入首付款数额!");
        //$('txtDownPayments').focus();
        window.setTimeout(function () { $('txtDownPayments').focus(); }, 0);
        return false;
    }
    if (isNaN($('txtDownPayments').value)) {
        alert("请输入数字!");
        $('txtDownPayments').value = "";
        //$('txtDownPayments').focus();
        window.setTimeout(function () { $('txtDownPayments').focus(); }, 0);
        return false;
    }

    var downPayments = Math.round($('txtMoney').value * 0.3);
    if (parseInt($('txtDownPayments').value) < parseInt(downPayments)) {
        //alert("首付款数额不能少于首付比例得30%!");
        $('txtDownPayments').value = downPayments;
        //$('txtDownPayments').focus();
        window.setTimeout(function () { $('txtDownPayments').focus(); }, 0);
        //return false;
    }
    if (parseInt($('txtDownPayments').value) > parseInt($('txtMoney').value)) {
        //alert("首付款数额不能多于购车价格!");
        $('txtDownPayments').value = $('txtMoney').value;
        //$('txtDownPayments').focus();
        window.setTimeout(function () { $('txtDownPayments').focus(); }, 0);
        //return false;
    }

    //贷款额
    calcLoanValue();
    //月付款
    calcMonthPayments();
    //首付额
    calcFirstDownPayments();
    calcTotal();
}

//贷款额=车辆购置价格-首付款
function calcLoanValue() {
    var loanValue = 0;
    if ($('txtDownPayments').value.length != 0) {
        loanValue = parseInt($('txtMoney').value) - parseInt($('txtDownPayments').value);
    }

    $('txtLoanValue').value = loanValue;
}


//首付款总额=首付款+必要花费+商业保险
function calcFirstDownPayments() {
    if (!ValidateVehicleAndVesselTax()) {
        return;
    }
    var firstDownPayments = 0;
    if ($('txtDownPayments').value.length != 0) {
        firstDownPayments = parseInt($('txtDownPayments').value) +
                parseInt($('txtAcquisitionTax').value) +
                parseInt($('txtChePai').value) +
                parseInt($('txtVehicleTax').value) +
                parseInt($('txtCompulsory').value) +
                parseInt($('txtCommonTotal').value);
    }
    $('txtFirstDownPayments').value = firstDownPayments;
}

//----------------------------

//购置税：购置附加税＝购车款／（1＋17％）× 购置税率，（税率：10%）
function calcAcquisitionTax() {
    var AcquisitionTax = AcquisitionTax = parseFloat($('txtMoney').value) / (1 + 0.17) * 0.1;
    $('txtAcquisitionTax').value = Math.round(AcquisitionTax);
}

//--------------------------------------------------

//您需要首付=首付款总额；
//月供=月付款；
//总计花费=首付款总额+月付款×还款年限×12
//比全款购车多花费=总计花费-车辆购置价格。
function calcTotal() {
    var moneyFirstDownPayments = parseInt($('txtFirstDownPayments').value);
    SetSpanValueByBrowerType('spanFirstDownPayments', formatCurrency(moneyFirstDownPayments));
    SetSpanValueByBrowerType('spanTopFirstDownPayments', formatCurrency(moneyFirstDownPayments));

    var moneyMonthPayments = parseInt($('txtMonthPayments').value);
    SetSpanValueByBrowerType('spanMonthPayments', formatCurrency(moneyMonthPayments));
    SetSpanValueByBrowerType('spanTopMonthPayments', formatCurrency(moneyMonthPayments));

    var strMonths = 12;
    var rdoPaymentYears = document.getElementsByName("rdoPaymentYears");
    for (i = 0; i < rdoPaymentYears.length; i++) {
        if (rdoPaymentYears[i].checked) {
            strMonths = rdoPaymentYears[i].value * 12;

            SetSpanValueByBrowerType('spanMonths', strMonths);
            SetSpanValueByBrowerType('spanTopMonths', strMonths);

            break;
        }
    }

    var moneyTotal = formatCurrency(moneyFirstDownPayments + moneyMonthPayments * strMonths);
    SetSpanValueByBrowerType('spanTotal', moneyTotal);
    SetSpanValueByBrowerType('spanTopTotal', moneyTotal);

    //比全款购车节省花费 = 贷款月利率 * 贷款年限 * 12 - 贷款额
    //var moneySaved = moneyTotal - parseFloat($('txtMoney').value);
    var moneySaved = formatCurrency(moneyMonthPayments * strMonths - parseInt($('txtLoanValue').value));
    SetSpanValueByBrowerType('spanSaved', moneySaved);
    SetSpanValueByBrowerType('spanTopSaved', moneySaved);
}

function getDefaultValue() {
    var hidBsID = $('hidBsID');
    var hidCsID = $('hidCsID');
    var hidCarID = $('hidCarID');

    initMainSelectValue = hidBsID.value;
    if (hidBsID.value == "0")
        initMainSelectValue = "-1";
    //    		//初始化主品牌列表
    //    		var PageSelectObject = StartInit("select", "select", "ddlPinpai", "ddlChexing", "CarType", "", "");
    //    		PageSelectObject.Init();
    bindSelect();

    if (hidBsID && hidCsID && hidCarID) {
        if (hidBsID.value != "-2" && hidCsID.value != "-1") {
            setSelected($("ddlPinpai"), hidBsID.value);

            //$("ddlPinpai").onchange();
            window.setTimeout(function () { setSelected($("ddlChexing"), hidCsID.value) }, 0.1);

            window.setTimeout(function () {
                getCarByCsID(hidCsID.value);
                if (hidCarID.value != "-1") {
                    setSelected($("ddlChekuan"), hidCarID.value);
                    $("ddlChekuan").onchange();
                    $('hidCarPrice').value = $('txtMoney').value;
                }
            }, 0.1);
        }
        else {
            //                    $("ddlPinpai").options[0].selected = true;
            //                    $("ddlChexing").options.length = 1;
            //                    $("ddlChekuan").options.length = 1;
        }
    }

    var hidCarPrice = $('hidCarPrice');
    var hidRdoPaymentYearsIdx = $('hidRdoPaymentYearsIdx');
    var hidRdoDownPaymentsIdx = $('hidRdoDownPaymentsIdx');
    if (hidCarPrice && hidRdoPaymentYearsIdx && hidRdoDownPaymentsIdx) {
        $('txtMoney').value = hidCarPrice.value;
        // alert($('txtMoney').value);
        if ($('txtMoney').value != 0) {
            $('txtChePai').value = 500;
            $('txtLimitOfPassenger').value = 50;

            $('rdoDownPaymentsOfSelf').disabled = false;
        }
        else {
            $('rdoDownPaymentsOfSelf').disabled = true;
        }

        var rdoDownPayments = document.getElementsByName("rdoDownPayments");
        var RdoDownPaymentsIdx = hidRdoDownPaymentsIdx.value;
        rdoDownPayments[RdoDownPaymentsIdx].checked = true;

        var rdoPaymentYears = document.getElementsByName("rdoPaymentYears");
        var RdoPaymentYearsIdx = hidRdoPaymentYearsIdx.value;
        rdoPaymentYears[RdoPaymentYearsIdx].checked = true;
    }
}

function ResetToDefault() {
    InitControl();
    initAutoLoanData();
    calcAutoLoanAll();
}

//显示广告
function displayAd() {
    var ddlCs = $("ddlChexing");
    if (!ddlCs)
        return;
    var csId = ddlCs.options[ddlCs.options.selectedIndex].value;
    var lAd = $("longAd");
    if (lAd) {
        //	modified by chengl Dec.1.2011
        // if (findCsInAdSet(csId))
        if (true)
            lAd.style.display = "block";
        else
            lAd.style.display = "none";
    }
}

function findCsInAdSet(csId) {
    var hasAd = false;
    for (var i = 0; i < hasAdSerials.length; i++) {
        if (csId == hasAdSerials[i]) {
            hasAd = true;
            break;
        }
    }
    return hasAd;
}
</script>




</body>

</wicket:border>
</html>
